<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <title>{% block title %} OpenID Consumer {% endblock %}</title>
  <link href="/static/base.css" rel="stylesheet" type="text/css"/>
  {% block head %}{% endblock %}
</head>

<body {% block bodyattributes %}{% endblock %}>

<div id="navbar">
    <a href="http://code.google.com/p/google-app-engine-samples/downloads/list">
      Download source</a>
  | <a href="http://openid.net/">OpenID</a>
  | <a href="http://code.google.com/appengine/">
      <img src="/static/appengine_button_noborder.gif"
           style="vertical-align: middle" /></a>
</div>

<div id="header">
  <a href="/"><img id ="openid-logo" alt="OpenID" src="/static/openid-logo.png" /></a>
  <p id="title">Example Consumer</p>
</div>

<div id="body">

<form method="post" action="/login">
Enter your OpenID URL:

<table><tr><td>
<p><input type="text" name="openid" id="openid" value="{{ claimed_id }}" />
<input type="submit" value="Login" /></p>
<input type="checkbox" name="display" id="display" checked="yes" />
<label for="display">Display this in the list of recent logins</label>

</td><td>

{% if response %}
  {% ifequal response.status "success" %}
    <span class="success">Success!</span><br />
    <nobr><a href="{{ response.endpoint.claimed_id }}">
      <img src="/static/openid-icon.png" />{{ response.endpoint.claimed_id }}
      </a></nobr><br />
    Server: <a href="{{ response.endpoint.server_url }}">
      {{ response.endpoint.server_url }}</a>
    {% if pape_data.auth_policies %}
      <i>{% for policy in pape_data.auth_policies %}{{ policy }} {% endfor %}</i>
    {% endif %}
    {% for field in sreg_data %}
      <br /> {{ field.0 }}: <i>{{ field.1 }}</i>
    {% endfor %}
  
  {% else %}
    <span class="cancel">Login cancelled.</span>
  {% endifequal %}

{% else %}{% if error %}
  <span class="error">{{ error }}</span>

{% endif %}{% endif %}
</td></tr></table>

</form>

<div class="top">
  <div class="left"></div>
  <div class="right"></div>
  Recent Logins
</div>

<table class="logins">
{% for login in logins %}
  <tr class="{{ login.status }}">
    <td class="status">
      <img class="icon" src="/static/{{ login.status }}.png"
           alt="{{ login.response }}" title="{{ login.status }}" />
    </td>
    <td class="openid">
      <a href="{{ login.claimed_id }}">
        {% ifnotequal login.status "failure" %}
          <img src="/static/openid-icon.png" />
        {% endifnotequal %}
        {{ login.display_name }}</a>
    </td>
    <td class="timestamp">
      {{ login.friendly_time }}
    </td>
  </tr>
{% endfor %}
{% if not logins %}
  <tr><td colspan="3" class="light" align="center">
  No logins yet. :(
  </td></tr>
{% endif %}
</table>

<div class="bottom">
<table class="key"><tr>
  <td class="success">
    <img class="icon" src="/static/success.png" /> Logged in
  </td>
  <td class="cancel">
    <img class="icon" src="/static/cancel.png" /> Cancelled
  </td>
  <td class="failure">
    <img class="icon" src="/static/failure.png" /> Failed
  </td>
</tr></table>

<div class="left"></div>
<div class="right"></div>

</div>
</div>

</body>
</html>
